Re: [Avogadro-devel] subclass QColumnView

2015-06-03 Thread Defusco III, Albert A
Dave and Marcus,

Thanks for your help. I needed to set the correct .h file in the promoted 
widget using QtCreator. I also needed to add 
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) to my CMakeLists.txt for the 
space group dialog.



Albert
--
___
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel


[Avogadro-devel] subclass QColumnView

2015-06-03 Thread Defusco III, Albert A
Hi everyone,

I am nearing completion of my space group dialog. You can see the current state 
on GitHub

https://github.com/AlbertDeFusco/avogadrolibs/tree/spg-rw

The next thing I need to do is remove the final preview widget from my 
QColumnView. I believe I can subclass it as follows in spacegroupdialog.cpp.

class spgColumnView : public QColumnView
{
  public:
spgColumnView(QWidget* p) : QColumnView(p) {}
QAbstractItemView * createColumn ( const QModelIndex  index )
{
  Avogadro::QtPlugins::SpaceGroupItem *thisItem = 
static_castAvogadro::QtPlugins::SpaceGroupItem*(index.internalPointer());
  QAbstractItemView *view = 0;
  if(thisItem-childCount() == 0)
return view;
  else
return QColumnView::createColumn(index);
}
};

I then change QColumnView to spgColumnView in spacegroupdialog.ui. When I try 
to build it I get the following error.

/Users/albert/Development/oc-clean/build/avogadrolibs/avogadro/qtplugins/crystal/ui_spacegroupdialog.h:26:10:
 fatal error: 'spgcolumnview.h' file not found
#include spgcolumnview.h
 ^


I was using the FileComboBox class, which is a subclass of QComboBox, in 
qtplugins/clientserver as an example. Is there something I have to do in CMake 
to get this to build? I tried setting SKIP_AUTOMOC to true for these source 
files, but it didn’t seem to work.


Thanks,
Albert



--
___
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel


Re: [Avogadro-devel] subclass QColumnView

2015-06-03 Thread David Lonie
Have you tried using QtDesigner to add it as a promoted widget, instead of
modifying the ui file directly? I suggest that approach as there may be
some non-obvious bits of the ui file that need to change as well.

On Wed, Jun 3, 2015 at 10:55 AM, Defusco III, Albert A defu...@pitt.edu
wrote:

 Hi everyone,

 I am nearing completion of my space group dialog. You can see the current
 state on GitHub

 https://github.com/AlbertDeFusco/avogadrolibs/tree/spg-rw

 The next thing I need to do is remove the final preview widget from my
 QColumnView. I believe I can subclass it as follows in spacegroupdialog.cpp.

 class spgColumnView : public QColumnView
 {
   public:
 spgColumnView(QWidget* p) : QColumnView(p) {}
 QAbstractItemView * createColumn ( const QModelIndex  index )
 {
   Avogadro::QtPlugins::SpaceGroupItem *thisItem =
 static_castAvogadro::QtPlugins::SpaceGroupItem*(index.internalPointer());
   QAbstractItemView *view = 0;
   if(thisItem-childCount() == 0)
 return view;
   else
 return QColumnView::createColumn(index);
 }
 };

 I then change QColumnView to spgColumnView in spacegroupdialog.ui. When I
 try to build it I get the following error.

 /Users/albert/Development/oc-clean/build/avogadrolibs/avogadro/qtplugins/crystal/ui_spacegroupdialog.h:26:10:
 fatal error: 'spgcolumnview.h' file not found
 #include spgcolumnview.h
  ^


 I was using the FileComboBox class, which is a subclass of QComboBox, in
 qtplugins/clientserver as an example. Is there something I have to do in
 CMake to get this to build? I tried setting SKIP_AUTOMOC to true for these
 source files, but it didn’t seem to work.


 Thanks,
 Albert




 --
 ___
 Avogadro-devel mailing list
 Avogadro-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/avogadro-devel

--
___
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel


Re: [Avogadro-devel] subclass QColumnView

2015-06-03 Thread Marcus D. Hanwell
On Wed, Jun 3, 2015 at 10:55 AM, Defusco III, Albert A defu...@pitt.edu wrote:
 Hi everyone,

 I am nearing completion of my space group dialog. You can see the current 
 state on GitHub

 https://github.com/AlbertDeFusco/avogadrolibs/tree/spg-rw

 The next thing I need to do is remove the final preview widget from my 
 QColumnView. I believe I can subclass it as follows in spacegroupdialog.cpp.

 class spgColumnView : public QColumnView
 {
   public:
 spgColumnView(QWidget* p) : QColumnView(p) {}
 QAbstractItemView * createColumn ( const QModelIndex  index )
 {
   Avogadro::QtPlugins::SpaceGroupItem *thisItem = 
 static_castAvogadro::QtPlugins::SpaceGroupItem*(index.internalPointer());
   QAbstractItemView *view = 0;
   if(thisItem-childCount() == 0)
 return view;
   else
 return QColumnView::createColumn(index);
 }
 };

 I then change QColumnView to spgColumnView in spacegroupdialog.ui. When I try 
 to build it I get the following error.

 /Users/albert/Development/oc-clean/build/avogadrolibs/avogadro/qtplugins/crystal/ui_spacegroupdialog.h:26:10:
  fatal error: 'spgcolumnview.h' file not found
 #include spgcolumnview.h
  ^
It looks like you are using the wrong include, should be  as this is
a local header, not  for system headers. The compiler will then
search the same directory automatically, as it knows that is the most
likely/default location.

 I was using the FileComboBox class, which is a subclass of QComboBox, in 
 qtplugins/clientserver as an example. Is there something I have to do in 
 CMake to get this to build? I tried setting SKIP_AUTOMOC to true for these 
 source files, but it didn’t seem to work.

You don't want to skip automoc.

Marcus

--
___
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel


Re: [Avogadro-devel] Require C++11/dropping Boost fallback

2015-06-03 Thread Michael Banck
On Wed, Jun 03, 2015 at 12:05:59PM -0400, Marcus D. Hanwell wrote:
 Ubuntu 14.04 LTS (last LTS release) was GCC 4.8.2, it looks like
 Debian stable is back on GCC 4.7.2. 

Debian stable (jessie) ahs GCC 4.8 and 4.9, but it got released very
recently and many are still on oldstable (wheezy) with GCC 4.7.


Michael

--
___
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel