[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/kexiutils
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2008-11-13 19:21:49
Message-ID: 1226604109.731490.5127.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 883886 by staniek:

Utils
- added KexiUtils::setStandardMarginsAndSpacing()



 M  +10 -1     utils.cpp  
 M  +7 -2      utils.h  


--- trunk/koffice/kexi/kexiutils/utils.cpp #883885:883886
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2003-2007 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2008 Jarosław Staniek <staniek@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -30,6 +30,7 @@
 #include <QFocusEvent>
 #include <QFile>
 #include <QStyle>
+#include <QLayout>
 
 #include <KDebug>
 #include <KCursor>
@@ -38,6 +39,7 @@
 #include <KIconLoader>
 #include <KGlobalSettings>
 #include <KAction>
+#include <KDialog>
 
 using namespace KexiUtils;
 
@@ -688,4 +690,11 @@
     }
 }
 
+void KexiUtils::setStandardMarginsAndSpacing(QLayout *layout)
+{
+    layout->setContentsMargins(
+        KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
+    layout->setSpacing( KDialog::spacingHint() );
+}
+
 #include "utils_p.moc"
--- trunk/koffice/kexi/kexiutils/utils.h #883885:883886
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2003-2007 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2008 Jarosław Staniek <staniek@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -34,6 +34,7 @@
 
 class QColor;
 class QMetaProperty;
+class QLayout;
 class KAction;
 
 //! @short General Utils
@@ -540,8 +541,11 @@
 protected:
     virtual void changeEvent(QEvent *event);
 };
-}
 
+/*! Sets KDialog::marginHint() margins and KDialog::spacingHint() spacing 
+ for the layout @a layout. */
+KEXIUTILS_EXPORT void setStandardMarginsAndSpacing(QLayout *layout);
+
 //! sometimes we leave a space in the form of empty QFrame and want to insert here
 //! a widget that must be instantiated by hand.
 //! This macro inserts a widget \a what into a frame \a where.
@@ -549,5 +553,6 @@
     { Q3VBoxLayout *lyr = new Q3VBoxLayout(where); \
         lyr->addWidget(what); }
 
+} //namespace KexiUtils
 
 #endif //KEXIUTILS_UTILS_H
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic